package cn.mjnxin.iot.base.domain;

/**
 * 描述一个节点的属性
 * @author CLG 2023年10月10日
 * @version V1.0.0
 */
public class NodeConfig{
	private boolean workAsClient;
	private Integer keyNo; // 识别编号
	private Integer pid; // 报文协议
	private String address; // 网络地址
	private Integer port; // 端口
	private Integer heartbeat = 2; // 心跳/超时 2分钟
	// 日志等级 0：无日志 1：报文长度日志 2：报文内容日志 3：所有日志
	private Integer logLevel;
	
	public NodeConfig(boolean workAsClient, Integer keyNo, Integer pid, String address, Integer port) {
		this.workAsClient = workAsClient;
		this.keyNo = keyNo;
		this.pid = pid;
		this.address = address;
		this.port = port;
	}
	
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Integer getPort() {
		return port;
	}
	public void setPort(Integer port) {
		this.port = port;
	}
	public Integer getPid() {
		return pid;
	}
	public void setPid(Integer pid) {
		this.pid = pid;
	}
	
	public String toString() {
		return pid + "|" + address + ":" + port;
	}

	public Integer getHeartbeat() {
		return heartbeat;
	}

	public void setHeartbeat(Integer heartbeat) {
		this.heartbeat = heartbeat;
	}

	public boolean isWorkAsClient() {
		return workAsClient;
	}

	public void setWorkAsClient(boolean workAsClient) {
		this.workAsClient = workAsClient;
	}

	public Integer getKeyNo() {
		return keyNo;
	}

	public void setKeyNo(Integer keyNo) {
		this.keyNo = keyNo;
	}

	public Integer getLogLevel() {
		return logLevel;
	}

	public void setLogLevel(Integer logLevel) {
		this.logLevel = logLevel;
	}
}
